package com.seu.project.seuquiz.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.seu.project.seuquiz.model.dto.contest.ContestQueryRequest;
import com.seu.project.seuquiz.model.dto.user.UserQueryRequest;
import com.seu.project.seuquiz.model.entity.Contest;
import com.seu.project.seuquiz.model.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;

/**
* @author 林怀旭
* @description 针对表【user(用户)】的数据库操作Service
* @createDate 2023-05-15 10:37:01
*/
public interface UserService extends IService<User> {
    /**
     *
     * @param studentID     学号
     * @param email         邮箱
     * @param college       学院
     * @param major         专业
     * @param userPassword  密码
     * @param checkPassword 确认密码
     * @return
     */

    long userRegister(String studentID,String email, String college, String major, String userPassword,String checkPassword);

    /**
     *
     *
     * @description: 用户登录
     * @param studentID 用户学号
     * @param userPassword 用户密码
     * @param request
     * @return: 脱敏后的用户信息
     * @author: linhuaixu
     * @time: 2023/5/15 14:52
     */

    User userLogin(String studentID, String userPassword, HttpServletRequest request);

    /**
     *
     *
     * @description: 获取当前登录用户
     * @param request
     * @return:
     * @author: linhuaixu
     * @time: 2023/5/15 16:45
     */

    User getLoginUser(HttpServletRequest request);

    /**
     *
     *
     * @description: 是否为管理员
     * @param request
     * @return:
     * @author: linhuaixu
     * @time: 2023/5/15 16:45
     */

    boolean isAdmin(HttpServletRequest request);

    /**
     *
     *
     * @description:
     * @param request
     * @return:
     * @author: linhuaixu
     * @time: 2023/5/15 16:45
     */

    boolean userLogout(HttpServletRequest request);

    /**
     * 用于所有参数模糊查询
     * @param request
     * @return
     */
    QueryWrapper<User> getQueryWrapper(UserQueryRequest request);

    /**
     * 所有参数等值查询
     * @param request
     * @return
     */
    QueryWrapper<User> getEqualQueryWrapper(UserQueryRequest request);

}
